#!/bin/bash
# run tsn eval_scores
# aggregate 2 modality's scores to obtain the final score
# shellcheck disable=SC1068

#ROOT_PATH=/home/shh_ucf
ROOT_PATH=/data2/hdu/shh
REPO_PATH=${ROOT_PATH}/tsn-mindspore-gpu
RGB_SCORE_PATH=${ROOT_PATH}/records-RGB/test-records
FLOW_SCORE_PATH=${ROOT_PATH}/records-RGB/test-records

RGB_EPOCH=$1
FLOW_EPOCH=$2

if [ $# != 2 ]; then
  echo "Usage: bash run_eval.sh [RGB_EPOCH] [FLOW_EPOCH]"
  echo "Just input the epoch num of each modality, the script will automatically complete the full command."
  echo "It will run as python eval_score.py scorefile1 scorefile2 --score_weights=None --crop_agg=mean"
  exit 1
fi

RGB_SCORE_PATH=${ROOT_PATH}/records-RGB/test-records/scores_RGB_${RGB_EPOCH}/RGB_scores.npz
FLOW_SCORE_PATH=${ROOT_PATH}/records-Flow/test-records/scores_Flow_${FLOW_EPOCH}/Flow_scores.npz

cd $ROOT_PATH
mkdir final_score_logs && cd final_score_logs
echo Now conducting the final score aggregation, log saved ad final_score_RGB\${RGB_EPOCH}_Flow${FLOW_EPOCH}.log in \
     `pwd`/final_score_RGB${RGB_EPOCH}_Flow${FLOW_EPOCH}.log

python ${REPO_PATH}/eval_scores.py $RGB_SCORE_PATH $FLOW_SCORE_PATH > RGB${RGB_EPOCH}_Flow${FLOW_EPOCH}.log &